package com.hf.work01;

/**
 * 汽车类
 * @author Lenovo-Healer
 */
public class Vehicle {

     // 属性
    /**
     * 汽车品牌
     */
    private String brand;
    /**
     * 颜色
     */
    private String color;
    /**
     * 速度
     */
    double speed = 0;
    /**
     * 无参构造方法
     */
    public Vehicle() {
    }
    //有参构造

    public Vehicle(String brand, String color) {
        this.brand = brand;
        this.color = color;
    }

    /**
     * 有参构造方法
     */

    public Vehicle(String brand, String color, double speed) {
        this.brand = brand;
        this.color = color;
        this.speed = speed;
    }
    //get/set方法


    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    /**
     * 奔跑功能
     */
    public void run(){
        System.out.println("汽车以"+speed+"迈速度奔跑");
    }
}
